import { ApiResponse, PageQuery } from './common-model'

// 服务器状态枚举
export enum ServerStatus {
  ACTIVE = 'active',
  ONLINE = 'online',
  OFFLINE = 'offline',
  MAINTENANCE = 'maintenance',
  DECOMMISSIONED = 'decommissioned'
}

// 服务器使用状态枚举
export enum ServerUsageStatus {
  IN_USE = 'in_use',
  AVAILABLE = 'available',
  RESERVED = 'reserved',
  RETIRED = 'retired'
}

// 服务器类型枚举
export enum ServerType {
  WEB = 'web',
  DATABASE = 'database',
  APPLICATION = 'application',
  FILE = 'file',
  CACHE = 'cache',
  PROXY = 'proxy',
  OTHER = 'other'
}

// 服务器环境枚举
export enum ServerEnvironment {
  TESTING = 'testing',
  DEVELOPMENT = 'development',
  PRODUCTION = 'production'
}

// 服务器实体模型
export interface Server {
  id: number
  ip: string
  hostname: string
  product_line?: string
  server_type: ServerType
  server_status: ServerStatus
  sn?: string
  rack_location?: string
  usage_status: ServerUsageStatus
  environment?: ServerEnvironment
  notes?: string
  // 物理信息字段
  cpu_model?: string
  cpu_cores?: number
  cpu_threads?: number
  memory_size?: number
  disk_size?: number
  disk_info?: string
  system_version?: string
  kernel_version?: string
  uptime?: number
  purchase_date?: string
  created_at: string
  updated_at: string
}

// 服务器创建请求
export interface ServerCreateRequest {
  ip: string
  hostname: string
  product_line?: string
  server_type: ServerType
  server_status: ServerStatus
  sn?: string
  rack_location?: string
  usage_status: ServerUsageStatus
  environment?: ServerEnvironment
  notes?: string
}

// 服务器更新请求
export interface ServerUpdateRequest {
  id: number
  ip?: string
  hostname?: string
  product_line?: string
  server_type?: ServerType
  server_status?: ServerStatus
  sn?: string
  rack_location?: string
  usage_status?: ServerUsageStatus
  environment?: ServerEnvironment
  notes?: string
  // 物理配置信息
  cpu_model?: string
  cpu_cores?: number
  cpu_threads?: number
  memory_size?: number
  disk_size?: number
  disk_info?: string
  system_version?: string
  kernel_version?: string
  // 时间信息
  uptime?: number
  purchase_date?: string
}
